/*
 * @Description: 路由配置页面
 * @Version: 1.0
 * @Author: wenbin
 * @Date: 2021-03-31 11:33:17
 * @LastEditors: wenbin
 * @LastEditTime: 2021-08-18 16:59:45
 * @FilePath: /magus-plugin/examples/router/index.js
 * Copyright (C) 2021 wenbin. All rights reserved.
 */

import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Home',
    component: () => import('@views/Home.vue'),
    meta: {
      isNeedLayout: true,
      title: '首页',
      showBreadcrumb: true
    }
  },
  {
    path: '/about',
    name: 'About',
    component: () => import( /* webpackChunkName: "about" */ '@views/About.vue'),
    meta: {
      isNeedLayout: true,
      title: '关于',
    }
  },
  {
    path: '/task',
    name: 'Task',
    component: () => import( /* webpackChunkName: "Task" */ '@views/taskList/page.vue'),
    meta: {
      isNeedLayout: false,
      title: '任务列表',
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import( /* webpackChunkName: "login" */ '@views/login/index.vue'),
    meta: {
      isNeedLayout: false,
      title: '登陆',
    }
  },
  {
    path: '/test',
    name: 'Test',
    component: () => import( /* webpackChunkName: "Test" */ '@views/test/index.vue'),
    meta: {
      isNeedLayout: true,
      title: '测试',
    },
    children: [
      {
        path: '/test/page',
        name: 'TestPage',
        component: () => import( /* webpackChunkName: "Test" */ '@views/test/page.vue'),
        meta: {
          isNeedLayout: true,
          title: '测试指标规则',
          showBreadcrumb: true
        },
      },
      {
        path: '/test/add',
        name: 'TestAdd',
        component: () => import( /* webpackChunkName: "Test" */ '@views/test/testAdd.vue'),
        meta: {
          isNeedLayout: true,
          title: '测试新增页面',
        },
      }
    ]
  },
  {
    path: '/error',
    name: 'Error',
    component: () => import( /* webpackChunkName: "error" */ '@views/error/index.vue'),
    meta: {
      isNeedLayout: false,
      title: '404',
    }
  },
  {
    path: '/appManage/:type/appDetail/:id/addVersion',
    name: 'AppManageAppDetailAddVersion',
    component: () => import( /* webpackChunkName: "AppManage" */ '@views/test/addVersion.vue'),
    meta: {
      isNeedLayout: true,
      title:  '新增应用',
    },
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router